/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DataMining;

/**
 *
 * @author Tuan
 */
public class Point {

    private Point(){}
    
    public Point(double X, double Y, double Z){
        this.X = X;
        this.Y = Y;
        this.Z = Z;
    }
    
    public Point(Point p){
        this.X = p.X;
        this.Y = p.Y;
        this.Z = p.Z;
    }
    
    public double X;
    
    public double  Y;
    
    public double Z;
    
    public double calculateDistance(Point p){
        return Math.sqrt((p.X - this.X)*(p.X - this.X) +  (p.Y - this.Y)*(p.Y - this.Y) + (p.Z - this.Z)*(p.Z - this.Z));
    }
    
    public boolean equals(Point p){
        return p.X == this.X && p.Y == this.Y && p.Z == this.Z;
    }
    
    public String toString(){        
        return "(" + MathExt.roundUp(X) + ", " + MathExt.roundUp(Y) + ", " + MathExt.roundUp(Z) + ")";
    }
    
}
